#pragma once
#include<functional>
#include<iostream>

//typedef std::function<void()> func_t
using task_t = std::function<void()>;

void Download()
{
    std::cout << "我是一个下载任务" << std::endl;
}

class Task
{
public:
    Task()
    {

    }
    Task(int x,int y):_x(x),_y(y)
    {
    }
    void Excute()
    {
        _result = _x + _y;
    }
    std::string debug()
    {
        std::string msg = std::to_string(_x) + "+" + std::to_string(_y) + "=?" ; 
        return msg;
    }
    void operator()()
    {
        Excute();
    }

    std::string result()
    {
        std::string msg = std::to_string(_x) + "+" + std::to_string(_y) + "=" + std::to_string(_result); 
        return msg;
    }   

private:
    int _x;
    int _y;
    int _result;
};
